layui.use(['table', 'admin', 'ax', 'laytpl','jquery'], function () {
    var $ = layui.$;
    var table = layui.table;
    var $ax = layui.ax;
    var admin = layui.admin;
    var laytpl = layui.laytpl;

     /**
      * 工程流水明细
      */
     var TaskFlow = {
         tableId: "taskFlowTable"
     };

    /**
     * 初始化表格的列
     */
     TaskFlow.initColumn = function () {
         return [[
             {field: 'name', title: '工程名称',width:200, align: "left",fixed: 'left', style:'font-size: 13px;font-weight:700;'},
             {field: 'taskFlowResultList', align: "left", height: 110,templet: '#statusTpl', title: '工程流水', style:'font-size: 12px;'}
         ]];
     };

    // 渲染表格
    var tableResult = table.render({
        elem: '#' + TaskFlow.tableId,
        url: Feng.ctxPath + "/project/proTaskFolwList?id=" + Feng.getUrlParam("id"),
        page: true,
        cellMinWidth: 100,
        cols: TaskFlow.initColumn(),
        done: function(res, curr, count){
            $(".layui-table-main  tr").each(function (index ,val) {
                $($(".layui-table-fixed .layui-table-body tbody tr")[index]).height($(val).height());
            });

            setTimeout(() => {
                $($(".layui-table-cell .line-box")).scrollLeft(6000)
            }, 500)
        }
    });

    //返回按钮
    $("#backupPage").click(function () {
        window.location.href = Feng.ctxPath + '/project/projectFlow'
    });
});
